
<?php echo $this->Form->create('User',array(
		'class' => 'form-horizontal',
		'inputDefaults' => array('label' => false, 'div' => 'controls')
))?>
	<fieldset>
		<div class="row-fluid">
			<?php echo $this->Html->link(__('Back to Index'), array('action' => 'index', 'admin' => true), array('class' => 'btn pull-right'))?>
		</div>
		<br>
		<div class='control-group'>
			<label class='control-label' for='username'><strong>Username</strong></label>
			<?php 
				echo $this->Form->input('username',array(
					'id' => 'username', 
					'class' => 'input-medium',
			))?>
		</div>
		<div class='control-group'>	
			<label class='control-label' for='password'><strong>Password</strong></label>
			<?php 
				echo $this->Form->input('pwd',array(
					'id' => 'password',
					'type' => 'password', 
					'class' => 'input-medium',
			))?>
		</div>
		<div class='control-group'>	
			<label class='control-label' for='name'><strong>Name</strong></label>
			<?php 
				echo $this->Form->input('name',array(
					'id' => 'name', 
					'class' => 'input-medium',
			))?>
		</div>
		<div class='control-group'>	
			<label class='control-label' for='email'><strong>Email</strong></label>
			<?php 
				echo $this->Form->input('email',array(
					'id' => 'email', 
					'class' => 'input-medium',
			))?>
		</div>
		<div class='control-group'>	
			<label class='control-label' for='address'><strong>Address</strong></label>
			<?php 
				echo $this->Form->input('address',array(
					'type' => 'text',
					'id' => 'address', 
					'class' => 'input-xlarge',
			))?>
		</div>
		
		
		<div class='control-group'>	
			<label class='control-label'><strong>Role</strong></label>
			<div class='controls'>
					<?php
						$roles = Configure::read('role');
						$currentRole = $this->Session->read('Auth.User.role');
						if ($currentRole == ROLE_PUBLISHER) {
							unset($roles[ROLE_ADMINISTRATOR]);
							unset($roles[ROLE_PUBLISHER]);
						} elseif ($currentRole == ROLE_ADMINISTRATOR) {
							unset($roles[ROLE_ADMINISTRATOR]);
						} 
						echo $this->Form->input('role',
							array(
								'type' => 'radio',
								'legend' => false,
								'div' => 'radio',
								'label' => array('class' => 'radio'),
								'default' => ROLE_AUTHOR,
								'options' => $roles
							)
						);
					?>
			</div>
		</div>
		<div class="form-actions">
            <button class="btn btn-primary" type="submit">Create</button>
            <button class="btn" type="reset">Reset</button>
          </div>
	</fieldset>
<?php echo $this->Form->end();?>